using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class DataSourcePage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string connectionString =
            WebConfigurationManager.ConnectionStrings[
                "RecruitVietnamDbConnectionString"
                ].ConnectionString;
            
            SqlDataSource sqlDataSource = new 
            SqlDataSource();
            sqlDataSource.ConnectionString= connectionString;
            sqlDataSource.SelectCommand="select " +
            "RecruiterID, Email,CompanyName,"
            + "ContactName,  Address,Phone" +
            " from tblRCAccounts" ;
            sqlDataSource.SelectCommandType = 
            SqlDataSourceCommandType.Text;

            DataList1.DataKeyField = "RecruiterID";
            DataList1.DataSource = sqlDataSource;
            DataList1.DataBind();
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }
}
